﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UPMS.Core.Domain.Mapping
{
    public class BaseMap<T> : EntityTypeConfiguration<T> where T : DomainBase
    {
        public BaseMap()
        {
            this.HasKey(a => a.Id).Property(a => a.Id).HasColumnName("Id");
            this.Property(a => a.Description).HasColumnName("Description").HasMaxLength(512);
            this.Property(a => a.Modified).HasColumnName("Modified").IsOptional();
            this.Property(a => a.ModifiedBy).HasColumnName("ModifiedBy").IsOptional();
            this.Property(a => a.Created).HasColumnName("Created").IsOptional();
            this.Property(a => a.CreatedBy).HasColumnName("CreatedBy").IsOptional();
        }
    }
}
